#ifndef DIALOG_H
#define DIALOG_H

#include <QObject>
#include <QDebug>
class Dialog : public QObject
{
    Q_OBJECT

public:
    explicit Dialog(QObject *parent = 0);
    void displayMessage(const QString &message)
    {
    }
signals:
    void sendText(const QString &text);

public slots:
    void receiveText(const QString &text)
    {
        qDebug()<<"收到1"<<text;
        displayMessage(tr("Received message: %1").arg(text));
    }

    void testreceive(const QString &text)
    {
        qDebug()<<"收到2"<<text;
    }

private slots:
    void clicked()
    {
//        if (text.isEmpty()) {
//            return;
//        }
        emit sendText("text");
//        displayMessage(tr("Sent message: %1").arg(text));
    }
private:
//    QDialog dialog;
};

#endif // DIALOG_H
